//
//  SliderView.m
//  NetEase
//
//  Created by Apple on 2018/5/5.
//  Copyright © 2018年 techbird. All rights reserved.
//

#import "SliderView.h"

@implementation SliderView
- (instancetype)init
{
    self = [super init];
    if (self) {
        self.backgroundColor = UIColor.orangeColor;
        self.frame = CGRectMake(-[UIScreen mainScreen].bounds.size.width, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height);
        [UIApplication.sharedApplication.keyWindow addSubview:self];
        
        UISwipeGestureRecognizer *swipGesture = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(swipeGestureAction:)];
        swipGesture.direction = UISwipeGestureRecognizerDirectionLeft;
        [self addGestureRecognizer:swipGesture];
    }
    return self;
}

- (void)swipeGestureAction:(UISwipeGestureRecognizer *)gesture{
    [UIView animateWithDuration:0.2 animations:^{
        self.frame = CGRectMake(-[UIScreen mainScreen].bounds.size.width, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height);
    }];
}


@end
